<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" href="{{ url_for('static',filename='layui/css/layui.css') }}">
    <link rel="stylesheet" href="{{ url_for('static',filename='layui/css/system-message.css') }}">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
    <style>
        .alert {
            position: relative;
            padding: .75rem 1.25rem;
            margin-bottom: 1rem;
            border: 1px solid transparent;
            border-radius: .25rem
        }

        .close {
            position: absolute;
            top: 0;
            right: 0;
            padding: .75rem 1.25rem;
            color: inherit
        }

        .alert-warning {
            color: #856404;
            background-color: #fff3cd;
            border-color: #ffeeba
        }

        .close {
            float: right;
            font-size: 1.5rem;
            font-weight: 700;
            line-height: 1;
            color: #000;
            text-shadow: 0 1px 0 #fff;
            opacity: .5
        }

        .close:focus, .close:hover {
            color: #000;
            text-decoration: none;
            opacity: .75
        }

        .close:not(:disabled):not(.disabled) {
            cursor: pointer
        }

        button.close {
            padding: 0;
            background-color: transparent;
            border: 0;
            -webkit-appearance: none
        }

        .close {
            padding: 1rem;
            margin: -1rem -1rem -1rem auto
        }

        .alert-dismissible .close {
            position: absolute;
            top: 0;
            right: 0;
            padding: .75rem 1.25rem;
            color: inherit
        }
    </style>
    {% block head %}{% endblock %}
    <style>{% block style %}{% endblock %}</style>
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <a href="{{ url_for('user.index') }}">
            <div class="layui-logo">图书管理系统</div>
        </a>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="#">
                    <img src="../static/icon.jpg" class="layui-nav-img">
                    {% if account.username %}
                        {{ account.username }}
                    {% else %}
                        {{ account.admin_name }}
                    {% endif %}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="{{ url_for('user.user_info') }}">个人信息</a></dd>
                    {% if account.username %}
                        <dd><a href="{{ url_for('user.change_password') }}">修改密码</a></dd>
                    {% endif %}
                </dl>
            </li>
            <li class="layui-nav-item"><a href="{{ url_for('logout') }}">退出登录</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">图书管理</a>
                    <dl class="layui-nav-child">
                        {% if account.admin_name %}
                            <dd><a href="{{ url_for('book.storage') }}">入库管理</a></dd>
                        {% endif %}
                        {% if account.username %}
                            <dd><a href="{{ url_for('book.borrow') }}">用户借书</a></dd>
                            <dd><a href="{{ url_for('book.return_book') }}">用户还书</a></dd>
                        {% endif %}
                        {% if account.admin_name and account.auth == 3 %}
                            <dd><a href="{{ url_for('book.logoff') }}">图书注销</a></dd>
                        {% endif %}
                    </dl>
                </li>
                {% if account.admin_name %}
                    <li class="layui-nav-item">
                        <a href="javascript:;">信息设置</a>
                        <dl class="layui-nav-child">
                            <dd><a href="{{ url_for('admin.change_info') }}">管理员信息设置</a></dd>
                            <dd><a href="javascript:;">图书馆信息设置</a></dd>
                            <dd><a href="javascript:;">图书词库设置</a></dd>
                        </dl>
                    </li>
                {% endif %}
                <li class="layui-nav-item">
                    <a href="{{ url_for('book.search_book') }}">图书信息查询</a>
                </li>
                <li class="layui-nav-item">
                    <a href="{{ url_for('book.search_student') }}">用户信息查询</a>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">图书信息专栏</a>
                    <dl class="layui-nav-child">
                        <dd><a href="{{ url_for('book.system_message') }}">系统信息公告</a></dd>
                        <dd><a href="{{ url_for('book.reader_letter') }}">读者来信</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">违规处罚</a>
                    {% if account.username %}
                        <dl class="layui-nav-child">
                            <dd><a href="{{ url_for('book.overdate_violation') }}">违规通知</a></dd>
                        </dl>
                    {% elif account.admin_name %}
                        <dl class="layui-nav-child">
                            <dd><a href="{{ url_for('book.admin_violation') }}">违规用户查询</a></dd>
                        </dl>
                    {% endif %}
                </li>

                {% if account.username %}
                    </li>
                    <li class="layui-nav-item">
                        <a class="" href="{{ url_for('book.recommend_book') }}">图书推荐</a>
                    </li>
                    </li>
                    <li class="layui-nav-item">
                        <a class="" href="{{ url_for('book.interloan') }}">图书互借</a>
                    </li>
                {% endif %}
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="layui-card layui-row layui-col-space10" style="margin:15px 10px;width:100%;">
            {% for message in get_flashed_messages() %}
                <div class="alert alert-warning">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    {{ message }}
                </div>
            {% endfor %}
            {% block card %}{% endblock %}
            {% block button %}{% endblock %}
            <div class="layui-card-body">
                {% block body %}
                {% endblock %}
            </div>
        </div>
    </div>

    <div class="layui-footer">
        Copyright 2023 Construct&nbsp;&nbsp;|&nbsp;&nbsp;版权所有:铁道游击队
    </div>
</div>
<script src="../static/layui/layui.js"></script>
<script>

    layui.use('element', function () {
        var element = layui.element;
        element.init();


    });
</script>

{% block script %}

{% endblock %}

</body>
</html>
